﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewRequest.aspx.cs" Inherits="BussnessTravel.NewRequest" %>

<%@ Register Src="../../Processes/ProcessControl/UserInfo_TY.ascx" TagName="UserInfo"
    TagPrefix="ui" %>
<%@ Register Src="../../Processes/ProcessControl/ApprovalHistory_TY.ascx" TagName="ApprovalHistory"
    TagPrefix="ah" %>
<%@ Register Src="../../Processes/ProcessControl/Attachments_TY.ascx" TagName="Attachments"
    TagPrefix="attach" %>
<%@ Register Src="../../Processes/ProcessControl/ButtonList_TY.ascx" TagName="ButtonList"
    TagPrefix="btn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>出差申请</title>
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <script src="../../js/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">

        jQuery(document).ready(function () {
            $("#lbTDAYTRAVEL").text($("#fld_TDAYTRAVEL").val());

            // $("#fld_TDATETRAVEL").attr("disabled", true);
            //            jQuery("");
            //            $("#fld_TDATETRAVEL").keydown(function (event) {
            //                return false;
            //            });
        })
        function isDigit() {
            //alert("33");
            return (event.keyCode < 0);
        }
        function daysBetween(DateOne, DateTwo) {
            var OneMonth = DateOne.substring(5, DateOne.lastIndexOf('-'));
            var OneDay = DateOne.substring(DateOne.length, DateOne.lastIndexOf('-') + 1);
            var OneYear = DateOne.substring(0, DateOne.indexOf('-'));

            var TwoMonth = DateTwo.substring(5, DateTwo.lastIndexOf('-'));
            var TwoDay = DateTwo.substring(DateTwo.length, DateTwo.lastIndexOf('-') + 1);
            var TwoYear = DateTwo.substring(0, DateTwo.indexOf('-'));

            var cha = 1 + ((Date.parse(OneMonth + '/' + OneDay + '/' + OneYear) - Date.parse(TwoMonth + '/' + TwoDay + '/' + TwoYear)) / 86400000);
            // return Math.abs(cha);
            if (cha > 0) {
                $("#fld_TDAYTRAVEL").val(cha);
                $("#lbTDAYTRAVEL").text(cha);


            }
            else {
                $("#fld_TDAYTRAVEL").val(0);
                $("#lbTDAYTRAVEL").text(0);
            }
        }

        function datediffTravelDate() {
            var beddate = $("#fld_TDATETRAVEL").val();
            var enddate = $("#fld_TDATEBACK").val();
            //alert(daysBetween(enddate,beddate));
            daysBetween(enddate, beddate);
        }

        function changeRMB_FP() {
            var je = $("#fld_TBORROWMONEY").val();
            if (isNaN(je)) {
                $("#fld_TBORROWMONEY").val("");
            }
        }

        function DecimalOnly(obj) {
            if (obj.value.indexOf(".") != -1 && (event.keyCode == 110 || event.keyCode == 190)) {
                event.returnValue = false
            }

            if (!((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 46 || event.keyCode == 110 || event.keyCode == 190))
                event.returnValue = false
            if (event.shiftKey && ((event.keyCode >= 48 && event.keyCode <= 57) || event.keyCode == 190)) event.returnValue = false
        }
    </script>
    <script type="text/javascript" language="javascript">
        window.onload = function () {
            document.getElementById("fld_YHKH").onkeyup = function () {
                this.value = this.value.replace(/\s/g, '').replace(/(\d{4})(?=\d)/g, "$1 "); ;
            };
        }; </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="row">
            <ui:userinfo id="UserInfo1" processtitle="出差申请" processprefix="Trval" tablename="PROC_BUSSNIESSTRAVEL"
                runat="server">
            </ui:userinfo>
        </div>
        <div class="row">
            <table class="table table-condensed table-bordered">
                <tr>
                    <td class="banner" colspan="4">
                        详细信息
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        出差目的地：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_TADDRESS" runat="server" class="validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        借款金额(无借款填0)：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_TBORROWMONEY" runat="server" money="money" class="validate[required]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        开户行：
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_KHH" runat="server" ></asp:TextBox>
                    </td>
                    <td class="td-label">
                        银行卡号：
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_YHKH" runat="server" ></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        出差日期：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <%--    
                        --%>
                        <asp:TextBox ID="fld_TDATETRAVEL" runat="server" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-#{%d}',maxDate:'#F{$dp.$D(\'fld_TDATEBACK\')}',isShowClear:false,readOnly:true})"
                            onchange="datediffTravelDate()" CssClass='validate[required] Wdate'></asp:TextBox>
                    </td>
                    <td class="td-label">
                        返回日期：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_TDATEBACK" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'fld_TDATETRAVEL\')}',isShowClear:false,readOnly:true})"
                            onchange="datediffTravelDate()" CssClass='validate[required] Wdate'></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        出差天数：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="lbTDAYTRAVEL" runat="server" Text=""></asp:Label>
                        <div style="display: none">
                            <asp:TextBox runat="server" ID="fld_TDAYTRAVEL"></asp:TextBox>
                        </div>
                        <asp:HiddenField runat="server" ID="hdfld_TDAYTRAVEL" />
                    </td>
                    <td class="td-label">
                        出差任务下达人：
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_TASSGINPERSON" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        出差类型：<span class="red">*</span>
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:DropDownList ID="fld_TRAVELTYPE" runat="server" CssClass="validate[required]">
                            <asp:ListItem Value="">--请选择--</asp:ListItem>
                            <asp:ListItem Value="项目出差">项目出差</asp:ListItem>
                            <asp:ListItem Value="非项目出差">非项目出差</asp:ListItem>
                            <asp:ListItem Value="项目现场调休">项目现场调休</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        具体出差计划：
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:TextBox ID="fld_TTRAVELTASK" TextMode="MultiLine" Height="80px" Width="98%"
                            runat="server"></asp:TextBox>
                    </td>
                </tr>
                <%--                <tr>
                <td class="td-label">
                        任务概述：
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:TextBox  TextMode="MultiLine" ID="fld_TDESCTASK"  Height="60px"  runat="server"  Width="98%"></asp:TextBox>
                    </td>
                </tr>--%>
            </table>
        </div>
        <div class="row">
            <attach:attachments id="Attachments1" runat="server">
            </attach:attachments>
        </div>
        <div class="row">
            <ah:approvalhistory id="ApprovalHistory1" showaction="false" runat="server">
            </ah:approvalhistory>
        </div>
        <div class="row">
        </div>
    </div>
    <btn:buttonlist id="ButtonList1" runat="server">
    </btn:buttonlist>
    <div style="display: none;">
    </div>
    </form>
</body>
</html>
